/ Assembly List / LJCNetCommon / NetCommon / XmlEncode

Namespace - LJCNetCommon


Parameters
text - The text to be encoded.

Returns

The encoded text.

Syntax

C#
public static String XmlEncode(String text)

Encodes a string with XML escape values. (E)

Example

C#
using LJCNetCommon;
        
// Encodes a string with XML escape values.
private static void XmlEncode()
{
  // Setup
  string xml = "<text>Here & There</text>";

  // Encodes a string with XML escape values.
  string encoded = NetCommon.XmlEncode(xml);

  // Check the text.
  string text = NetCommon.XmlDecode(encoded);
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.